//
//  WYRImageView.m
//  绘制图片
//
//  Created by 伍银荣 on 2021/7/2.
//  Copyright © 2021 com.example. All rights reserved.
//

#import "WYRImageView.h"

@implementation WYRImageView

-(void)setImage:(UIImage *)image {
    _image = image;
    //重绘
    [self setNeedsDisplay];
}

- (instancetype)initWithImage:(UIImage *)image
{
    self = [super initWithFrame:CGRectMake(0, 0, image.size.width, image.size.height)];
    if (self) {
        self.image = image;
    }
    return self;
}


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
    [self.image drawInRect:rect];
}


@end
